
//=== Shared samplers =========================================================

#define DIFFUSEMAP sampler2D diffuseMapSampler : register (s0) { Texture = $Diffuse; sRGBLookup = true; };
#define BUMPMAP sampler2D bumpMapSampler : register (s1) { Texture = $Bump; };
#define BUMPHEIGHTMAP sampler2D bumpHeightMapSampler { Texture = $BumpHeight; };
#define GLOSSMAP sampler2D glossMapSampler : register (s2) { Texture = $Gloss; sRGBLookup = true; };

#define BUMPDIFFUSEMAP sampler2D bumpMapSampler_Diffuse = sampler_state { Texture = $BumpDiffuse; };
#define OPACITYMAP sampler2D opacityMapSampler = sampler_state { Texture = $Opacity; };
#define DETAILMAP sampler2D detailMapSampler = sampler_state { Texture = $Detail; sRGBLookup = true; };
#define ENVIRONMENTMAP sampler2D envMapSampler = sampler_state { Texture = $Env; sRGBLookup = true; };
#define ENVIRONMENTCUBEMAP samplerCUBE envMapSamplerCUBE = sampler_state { Texture = $EnvironmentCubeMap; AddressU = Clamp; AddressV = Clamp; };
#define SUBSURFACEMAP sampler2D subsurfaceMapSampler = sampler_state { Texture = $Subsurface; sRGBLookup = true; };
#define DECALMAP sampler2D decalMapSampler = sampler_state { Texture = $DecalOverlay; };

#define SHADOWOCCLUDEMAP  \
sampler2D shadowOccludeMapSampler : register (s3) \
{ \
 Texture = $ScreenShadowMap;  \
 MinFilter = POINT;  \
 MagFilter = POINT;  \
 MipFilter = POINT;  \
 AddressU = Clamp;  \
 AddressV = Clamp;  \
};  \

#define SCENEDEPTHMAP  \
sampler2D sceneDepthSampler = sampler_state \
{ \
	Texture = $ZTarget; \
	MinFilter = POINT; \
	MagFilter = POINT; \
	MipFilter = POINT; \
	AddressU = Clamp; \
	AddressV = Clamp; \
};

#define SCENE_UVS_MAP  \
sampler2D sceneUVsSampler = sampler_state \
{ \
	Texture = $SceneUVsMap; \
	MinFilter = POINT; \
	MagFilter = POINT; \
	MipFilter = POINT; \
	AddressU = Clamp; \
	AddressV = Clamp; \
};

#define SCENE_NORMALS_MAP  \
sampler2D sceneNormalsSampler : register (s12) \
{ \
  Texture = $SceneNormalsMap; \
  MinFilter = POINT; \
  MagFilter = POINT; \
  MipFilter = POINT; \
  AddressU = Clamp; \
  AddressV = Clamp; \
  Global = true;    \
}; \

#define SCENE_NORMALS_BENT  \
sampler2D sceneNormalsBentSampler : register (s14) \
{ \
  Texture = $SceneNormalsBent; \
  MinFilter = POINT; \
  MagFilter = POINT; \
  MipFilter = POINT; \
  AddressU = Clamp; \
  AddressV = Clamp; \
  Global = true;    \
}; \

#define SCENE_DIFFUSEACC_MAP  \
sampler2D sceneDiffuseAccSampler : register (s13) \
{ \
  Texture = $SceneDiffuseAcc; \
  MinFilter = POINT; \
  MagFilter = POINT; \
  MipFilter = POINT; \
  AddressU = Clamp; \
  AddressV = Clamp; \
  Global = true;    \
}; \

#define SCENE_SPECULARACC_MAP  \
sampler2D sceneSpecularAccSampler : register (s10) \
{ \
  Texture = $SceneSpecularAcc; \
  MinFilter = POINT; \
  MagFilter = POINT; \
  MipFilter = POINT; \
  AddressU = Clamp; \
  AddressV = Clamp; \
  Global = true;    \
}; \

#define SCENE_DECALS_ACC_MAP  \
sampler2D decalsAccSampler : register (s11) \
{ \
 Texture = $DecalsTarget;  \
 MinFilter = POINT;  \
 MagFilter = POINT;  \
 MipFilter = POINT;  \
 AddressU = Clamp;  \
 AddressV = Clamp;  \
};  \

#define SCENE_HDRTARGET_ENCODED_MAP  \
sampler2D HDRTargetEncodedSampler = sampler_state \
{ \
  Texture = $HDRTargetEncoded; \
  MinFilter = POINT; \
  MagFilter = POINT; \
  MipFilter = POINT; \
  AddressU = Clamp; \
  AddressV = Clamp; \
}; \

// Scene map contains snow pass during forward pass.
#define SCENE_SNOW_MAP_SAMPLER  \
sampler2D sceneSnowMapSampler = sampler_state \
{ \
 Texture = $SceneTarget;  \
 MinFilter = POINT;  \
 MagFilter = POINT;  \
 MipFilter = POINT;  \
 AddressU = Clamp;  \
 AddressV = Clamp;  \
};  \

#define PROJECTIONCUBE samplerCUBE projCubeSampler = sampler_state  {  Texture = $FromLight; AddressU = Clamp; AddressV = Clamp; sRGBLookup = true; };
#define PROJECTIONMAP sampler2D projMapSampler = sampler_state  {  Texture = $FromLight; sRGBLookup = true; };

#define CLOUD_SHADOW_MAP \
sampler2D cloudShadowMap = sampler_state \
{ \
 Texture = $CloudsLM; \
 MinFilter = LINEAR; \
 MagFilter = LINEAR; \
 MipFilter = POINT; \
 AddressU = Wrap; \
 AddressV = Wrap; \
};
